<div class="flickerContainer">
    <% if scroll %>
    	<% @pictures = Array.new(a.medias.size-1) %>
  		<% j = 0 %>
  		<% for @media in a.medias %>
  			<% if @media.is_a? Picture%>
  				<% @pictures[j] = '/picture/file/' + @media.file_relative_path("thumb") %>
  				<% j = j +1 %>
  			<% end %>
      <% end %>
    <% else %>
    	<% @pictures = Array.new(1) %>
      <% picture = a.medias.select {|m| m.is_a? Picture}.first %>
      <% @pictures[0] = '/picture/file/' + picture.file_relative_path("thumb") if picture %>
		<% end %>
	<div class="flickerImageBox">
	  <%= link_to image_tag('', :id => "thisImageContainer_#{curr_flicker_id}"), a %>
	</div>
	<br />
  
  <a href="javascript:void(0);" id="thisLeftButton_<%=curr_flicker_id%>">&laquo;</a>
  <span id="thisTextContainer_<%=curr_flicker_id%>"></span>
  <a href="javascript:void(0);" id="thisRightButton_<%=curr_flicker_id%>">&raquo;</a>
  
	<script type="text/javascript">new ImageFlicker("thisLeftButton_<%=curr_flicker_id%>", "thisRightButton_<%=curr_flicker_id%>", "thisImageContainer_<%=curr_flicker_id%>", "thisTextContainer_<%=curr_flicker_id%>", <%= @pictures.to_json %> ) </script>
</div>